package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 *
 * @author lyl
 * @created 2025/9/30 15:57
 * @description
 *
 */
@Mapper
public interface RoleMapper {
    List<Role> page(@Param("name") String name,@Param("label") String label);

    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void addRole(Role role);

    @Select("select id, name, label, remark, create_time, update_time from role where id = #{id}")
    Role getRoleById(Integer id);

    void updateRole(Role role);

    @Delete("delete from role where id = #{id}")
    void deleteRole(Integer id);

    @Select("select id, name, label, remark, create_time, update_time from role")
    List<Role> getAll();
}
